const seq = require('../db_connect'),
      { STRING, INT, TEXT, DECIMAL } = require('../../configs/db_type');

const Teacher = seq.define('teacher', {
  tid: {
    comment: 'Teacher_ID',
    type: 'INT',
    allowNull: false,
    unique: true
  },
  href: {
    comment: 'Teacher_intro_href',
    type: STRING,
    allowNull: false
  },
  teacherName: {
    comment: 'Teacher_name',
    type: STRING,
    allowNull: false
  },
  teacherImgUrl: {
    comment: 'Teacher_image_url', 
    type: STRING,
    allowNull: false
  },
  courseCount: {
    comment: 'Course_count_of_teacher',
    type: INT,
    allowNull: false
  },
  studentCount: {
    comment: 'The_student_number_of_the_teacher',
    type: INT,
    allowNull: false
  },
  intro: {
    comment: 'Teacher_introduction',
    type: TEXT,
    allowNull: false
  },
  teacherImgKey: {
    comment: 'Qiniu_teacher_image_url',
    type: STRING,
    allowNull: false
  },
  isStar: {
    comment: 'Is_the_teacher_a_star_teacher_?',
    type: INT,
    defaultValue: 0,
    allowNull: false
  },
  status: {
    comment: 'teacher_status', //控制是否显示
    type: INT,
    defaultValue: 1,  
    allowNull: false  //设初始值要同时设置非空
  }
})

module.exports = Teacher;